import { defineAsyncComponent, App } from "vue";
const pageComponents = import.meta.glob("./pages/*.vue");
const customComponents = import.meta.glob("./components/form/custom/*.vue");
export default function install(app: App) {
  for (const [key, value] of Object.entries(pageComponents)) {
    const name = key.split(".vue")[0].split("/").reverse()[0];
    app.component(name, defineAsyncComponent(value));
  }
  for (const [key, value] of Object.entries(customComponents)) {
    const name = key.split(".vue")[0].split("/").reverse()[0];
    app.component(name, defineAsyncComponent(value));
  }
}
